// @algorithm @lc id=100335 lang=cpp
// @title bu-yong-jia-jian-cheng-chu-zuo-jia-fa-lcof

#include "algm/algm.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
    int add(int a, int b) {
        while (b != 0) {
            // c存储了进位信息，保存进位值
            int c = (unsigned int)(a & b) << 1;
            // 保存不进位值
            a ^= b;
            // 如果还有进位，再循环
            b = c;
        }
        return a;
    }
};